-
-
Notifications
You must be signed in to change notification settings - Fork 314
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for custom endpoint metadata definitions #381
Add support for custom endpoint metadata definitions #381
Conversation
Very well done. But I'd rather avoid the magic ("any unknown properties go into My idea of this was providing the return [
"groupName" => "...",
"custom" => [
"a" => "b"
]
]; would overwrite the public function __invoke($endpointData)
{
$endpointData->custom['a'] = 'b';
} A second concern of mine is wrt serializing to the Camel files and loading from them. Did you test that the custom properties were serialized to the YAML as well, and properly loaded from them (can check this with |
Sounds good, I'll update tomorrow |
983b001
to
f7d767b
Compare
Hi @shalvah, I've updated to modify the custom property directly. I can confirm that YAML serialization and extraction is working as expected. |
f7d767b
to
f58476e
Compare
public function __invoke(ExtractedEndpointData $endpointData, array $routeRules): ?array | ||
{ | ||
$endpointData->metadata->custom['myProperty'] = 'some custom metadata'; | ||
return null; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think this matters, does it? Functions in PHP implicitly return null.
Oh, this is because of the type annotation requiring a return statement.
3.19.0 '👍 |
Resolves #380
I'll make a separate PR for the docs